package tmp.brandFixed;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Map;

public class Brand {
	public Map<String, String> brandMap=null;
	private static Brand brand=null;
	private Brand(){
		brandMap=new HashMap<String, String>();
		Connection con=DAO.DbcpConnection.getConnection();
		try {
			Statement st=con.createStatement();
			ResultSet rs=st.executeQuery("select * from map_brand");
			while (rs.next()) {
				String key=rs.getString("from");
				String value=rs.getString("to");
				this.brandMap.put(key, value);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	public static Brand getInstance(){
		if(brand==null){
			brand=new Brand();
		}
		return brand;
	}
}
